<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML" 4.01"//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!-- Created:September 28, 2001-->
<!--
$Id: AdminLoc.php,v 1.5 2001/12/06 19:49:34 eugenem Exp $
$Header: /export/home/eugenem/public_html/ComplianceReports/RCS/AdminLoc.php,v 1.5 2001/12/06 19:49:34 eugenem Exp $
$Log: AdminLoc.php,v $
Revision 1.5  2001/12/06 19:49:34  eugenem
Display table of locations currently stored in the DB.

Revision 1.4  2001/11/02 19:02:23  eugenem
Moved HTTP_*_VARS processing to dbc.inc

Revision 1.3  2001/11/02 14:56:06  eugenem
Moved database connect statements to a separate file.

Revision 1.2  2001/10/18 15:08:16  eugenem
Add description about what this page does.

Revision 1.1  2001/09/28 18:27:34  eugenem
Initial revision

-->

<html>
<head>
<title>Radiology Equipment Database</title>
<meta name="author" content="Eugene Mah">
<link rev="made" href="mailto:eugenem@ix.netcom.com">
<link rev="home" href="http://home.netcom.com/~eugenem/">
<meta name="description" content="">
<meta name="Keywords" content="">
<meta name="Reply-to" content="eugenem@ix.netcom.com">
<META http-equiv="PICS-Label" content='(PICS-1.1 "http://www.classify.org/safesurf/" l r (SS~~0001))'>
<!--
AdminLoc.php

Function:
This page allows the user to add new locations to the Locations table of the database.

Dependencies:
None
-->
<?PHP
require('functions.inc');
require('dbc.inc');

?>
</head>

<body>
<h1>Radiology Equipment Database</h1>
<?PHP

if (isset($Location)) {
  /*
    Adding a new location
  */
  $query = "insert into Location (Location) values (\"$Location\")";

  $result = mysql_query($query)
    or die ("<p>Unable to insert: $query</p>");

  echo "<h2>Location Added</h2>\n";
  echo "<p>$Location has been added to the database</p>\n";
}

$query = "select * from Location";
$loc = mysql_query($query)
  or die ("<p>Unable to execute query: $query</p>\n");

echo "<h2>Current Locations</h2>\n";
echo "<table border=\"1\" cellpadding=\"3\">\n";
while ($row = mysql_fetch_row($loc)) {
  echo "<tr>\n";
  echo "  <td>" . $row[0] . "</td>\n";
  echo "  <td>" . $row[1] . "</td>\n";
  if (!($row = mysql_fetch_row($loc))) continue;
  else {
    echo "  <td>" . $row[0] . "</td>\n";
    echo "  <td>" . $row[1] . "</td>\n";
  }
  echo "</tr>\n";
}
echo "</table>\n";
?>
<h2>Add a Location</h2>
<!-- Add a new location -->
<p>
<form action="AdminLoc.php" method="POST">
New Location: <input type="TEXT" name="Location" size="20">
<input type="SUBMIT" value="Add Location"> / <input type="RESET" value="Reset"> / <a href="index.html" target="_top" >Main</a>
</form>
</p>

</body>
</html>
